<?php

namespace App\Providers;

use Illuminate\Queue\Events\JobFailed;
use Illuminate\Support\Facades\Queue;
use Illuminate\Support\ServiceProvider;

/**
 * 失败的Job，飞书报错提醒
 */
class JobFailedServiceProvider extends ServiceProvider
{

    public function register()
    {
        //
    }

    public function boot()
    {
        Queue::failing(function (JobFailed $event) {
            \ExceptionNotifier::report($event->exception);
        });
    }
}
